package com.foreveross.smsh.core.pojo;

import java.io.Serializable;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;


public abstract class Pojo  implements Serializable {
	
	private static final long serialVersionUID = 1L;

	public abstract void setId(String id);
	public abstract String getId();
	public String toString() {
		return ReflectionToStringBuilder.toString(this,ToStringStyle.SHORT_PREFIX_STYLE);
	}

	public int hashCode() {
		return this.getId().hashCode();
	}

	public boolean equals(Object pojo) {
		if(pojo==null) return false;
		if(this.getClass()!=pojo.getClass()) return false;
		if(!(pojo instanceof Pojo)) return false;
		return this.getId().equals(((Pojo)pojo).getId());
	}
}
